/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */


$(function () {
    $('#LoanId').change(function () {
        var id = $(this).children('option:selected').val();//这就是selected的值 
        $.post('getLoanById', {id: id}, function (data) {
            $("#ApplyAmount").val(data.ApplyAmount);
            $("#RepayMentDateTime").val(data.RepayMentDateTime);
            $("#SeedAmount").val(data.SeedAmount);
        }, 'json');
    })
    $('#LoanId').trigger("change");
});
function setLoan(userid) {
    $.post('getLoanByDriver', {userid: userid}, function (data) {
        $("#LoanId").html(data);
        var id = $("#LoanId").children('option:selected').val();//这就是selected的值 
        $.post('getLoanById', {id: id}, function (data) {
            $("#ApplyAmount").val(data.ApplyAmount);
            $("#RepayMentDateTime").val(data.RepayMentDateTime);
            $("#SeedAmount").val(data.SeedAmount);
        }, 'json');
    });
}